import htmlminifierterser from "html-minifier-terser";
//@ts-ignore
import minifyopts from "./minifyopts.js";

// export async function minifyhtml(states: StateType) {
//     const { minify } = htmlminifierterser;
//     const opts = minifyopts;
//     await Promise.all(
//         [states.cachemain, states.cachetoc].map(async (map) => {
//             for (let [key, value] of map.entries()) {
//                 //@ts-ignore
//                 let result = await minify(value, opts);

//                 map.set(key, result);
//             }
//         })
//     );
//     // const map = states.cachemain;
// }
export async function minifyhtml(html: string): Promise<string> {
    const value = html;
    const { minify } = htmlminifierterser;
    const opts = minifyopts;
    // await Promise.all(
    //     [states.cachemain, states.cachetoc].map(async (map) => {
    //         for (let [key, value] of map.entries()) {
    //@ts-ignore
    let result = await minify(value, opts);
    return result;
    //             map.set(key, result);
    //         }
    //     })
    // );
    // const map = states.cachemain;
}
